package com.power.sifa.correction.model.enumeration;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * 矫正类别枚举类
 */
public enum Tp_crc_userEnum {

    CONTROL(6401800, "管制"),
    PROBATION(6401801, "缓刑"),
    PAROLE(6401802, "假释"),
    OUTPRISON(6401803, "暂予监外执行");

    private int value;
    private String typeName;

    Tp_crc_userEnum(int value, String typeName) {
        this.value = value;
        this.typeName = typeName;
    }

    public int getValue() {
        return value;
    }

    public String getTypeName() {
        return typeName;
    }

    public static String getTypeNameByValue(int value) {
        for (Tp_crc_userEnum type : Tp_crc_userEnum.values()) {
            if (type.getValue() == value) {
                return type.getTypeName();
            }
        }
        return null;
    }
}
